/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Adam
 */
@Entity
@Table(name = "reports")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reports.findAll", query = "SELECT r FROM Reports r"),
    @NamedQuery(name = "Reports.findByReportId", query = "SELECT r FROM Reports r WHERE r.reportId = :reportId"),
    @NamedQuery(name = "Reports.findByLatitude", query = "SELECT r FROM Reports r WHERE r.latitude = :latitude"),
    @NamedQuery(name = "Reports.findByLongitude", query = "SELECT r FROM Reports r WHERE r.longitude = :longitude"),
    @NamedQuery(name = "Reports.findByStreet", query = "SELECT r FROM Reports r WHERE r.street = :street"),
    @NamedQuery(name = "Reports.findByCity", query = "SELECT r FROM Reports r WHERE r.city = :city"),
    @NamedQuery(name = "Reports.findByState", query = "SELECT r FROM Reports r WHERE r.state = :state"),
    @NamedQuery(name = "Reports.findByStreetNoaccent", query = "SELECT r FROM Reports r WHERE r.streetNoaccent = :streetNoaccent"),
    @NamedQuery(name = "Reports.findByCityNoaccent", query = "SELECT r FROM Reports r WHERE r.cityNoaccent = :cityNoaccent"),
    @NamedQuery(name = "Reports.findBySeen", query = "SELECT r FROM Reports r WHERE r.seen = :seen"),
    @NamedQuery(name = "Reports.findByAdded", query = "SELECT r FROM Reports r WHERE r.added = :added"),
    @NamedQuery(name = "Reports.findByDescription", query = "SELECT r FROM Reports r WHERE r.description = :description"),
    @NamedQuery(name = "Reports.findBySource", query = "SELECT r FROM Reports r WHERE r.source = :source"),
    @NamedQuery(name = "Reports.findByNComments", query = "SELECT r FROM Reports r WHERE r.nComments = :nComments"),
    @NamedQuery(name = "Reports.findByNThumbUps", query = "SELECT r FROM Reports r WHERE r.nThumbUps = :nThumbUps"),
    @NamedQuery(name = "Reports.findByNThumbDowns", query = "SELECT r FROM Reports r WHERE r.nThumbDowns = :nThumbDowns"),
    @NamedQuery(name = "Reports.findByReported", query = "SELECT r FROM Reports r WHERE r.reported = :reported")})
public class Reports implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "report_id")
    private Integer reportId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "latitude")
    private double latitude;
    @Basic(optional = false)
    @NotNull
    @Column(name = "longitude")
    private double longitude;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "street")
    private String street;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "city")
    private String city;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "state")
    private String state;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "street_noaccent")
    private String streetNoaccent;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "city_noaccent")
    private String cityNoaccent;
    @Basic(optional = false)
    @NotNull
    @Column(name = "seen")
    @Temporal(TemporalType.TIMESTAMP)
    private Date seen;
    @Basic(optional = false)
    @NotNull
    @Column(name = "added")
    @Temporal(TemporalType.TIMESTAMP)
    private Date added;
    @Size(max = 150)
    @Column(name = "description")
    private String description;
    @Size(max = 80)
    @Column(name = "source")
    private String source;
    @Basic(optional = false)
    @NotNull
    @Column(name = "n_comments")
    private int nComments;
    @Basic(optional = false)
    @NotNull
    @Column(name = "n_thumb_ups")
    private int nThumbUps;
    @Basic(optional = false)
    @NotNull
    @Column(name = "n_thumb_downs")
    private int nThumbDowns;
    @Basic(optional = false)
    @NotNull
    @Column(name = "reported")
    private int reported;
    @JoinColumn(name = "type_id", referencedColumnName = "type_id")
    @ManyToOne(optional = false)
    private Types typeId;
    @JoinColumn(name = "user_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private Users userId;
    @JoinColumn(name = "area_id", referencedColumnName = "area_id")
    @ManyToOne(optional = false)
    private Areas areaId;

    public Reports() {
    }

    public Reports(Integer reportId) {
        this.reportId = reportId;
    }

    public Reports(Integer reportId, double latitude, double longitude, String street, String city, String state, String streetNoaccent, String cityNoaccent, Date seen, Date added, int nComments, int nThumbUps, int nThumbDowns, int reported) {
        this.reportId = reportId;
        this.latitude = latitude;
        this.longitude = longitude;
        this.street = street;
        this.city = city;
        this.state = state;
        this.streetNoaccent = streetNoaccent;
        this.cityNoaccent = cityNoaccent;
        this.seen = seen;
        this.added = added;
        this.nComments = nComments;
        this.nThumbUps = nThumbUps;
        this.nThumbDowns = nThumbDowns;
        this.reported = reported;
    }

    public Integer getReportId() {
        return reportId;
    }

    public void setReportId(Integer reportId) {
        this.reportId = reportId;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getStreetNoaccent() {
        return streetNoaccent;
    }

    public void setStreetNoaccent(String streetNoaccent) {
        this.streetNoaccent = streetNoaccent;
    }

    public String getCityNoaccent() {
        return cityNoaccent;
    }

    public void setCityNoaccent(String cityNoaccent) {
        this.cityNoaccent = cityNoaccent;
    }

    public Date getSeen() {
        return seen;
    }

    public void setSeen(Date seen) {
        this.seen = seen;
    }

    public Date getAdded() {
        return added;
    }

    public void setAdded(Date added) {
        this.added = added;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public int getNComments() {
        return nComments;
    }

    public void setNComments(int nComments) {
        this.nComments = nComments;
    }

    public int getNThumbUps() {
        return nThumbUps;
    }

    public void setNThumbUps(int nThumbUps) {
        this.nThumbUps = nThumbUps;
    }

    public int getNThumbDowns() {
        return nThumbDowns;
    }

    public void setNThumbDowns(int nThumbDowns) {
        this.nThumbDowns = nThumbDowns;
    }

    public int getReported() {
        return reported;
    }

    public void setReported(int reported) {
        this.reported = reported;
    }

    public Types getTypeId() {
        return typeId;
    }

    public void setTypeId(Types typeId) {
        this.typeId = typeId;
    }

    public Users getUserId() {
        return userId;
    }

    public void setUserId(Users userId) {
        this.userId = userId;
    }

    public Areas getAreaId() {
        return areaId;
    }

    public void setAreaId(Areas areaId) {
        this.areaId = areaId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (reportId != null ? reportId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reports)) {
            return false;
        }
        Reports other = (Reports) object;
        if ((this.reportId == null && other.reportId != null) || (this.reportId != null && !this.reportId.equals(other.reportId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Reports[ reportId=" + reportId + " ]";
    }
    
}
